package com.wisdudu.blank.data.bean;

import android.content.Intent;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by qyf on 2016/8/16.
 */

public class RequestInfo implements Parcelable {
    //设置默认值为resultCode=0,resultData=null
    public RequestInfo(int requestCode, int resultCode, Intent resultData) {
        this.requestCode = requestCode;
        this.resultCode = resultCode;
        this.resultData = resultData;
    }


    public int requestCode;
    public int resultCode;
    public Intent resultData;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.requestCode);
        dest.writeInt(this.resultCode);
        dest.writeParcelable(this.resultData, flags);
    }

    public RequestInfo() {
    }

    protected RequestInfo(Parcel in) {
        this.requestCode = in.readInt();
        this.resultCode = in.readInt();
        this.resultData = in.readParcelable(Intent.class.getClassLoader());
    }

    public static final Parcelable.Creator<RequestInfo> CREATOR = new Parcelable.Creator<RequestInfo>() {
        @Override
        public RequestInfo createFromParcel(Parcel source) {
            return new RequestInfo(source);
        }

        @Override
        public RequestInfo[] newArray(int size) {
            return new RequestInfo[size];
        }
    };
}
